﻿<html>
  <head>
    <meta name="generator" content="h-smile:richtext"/>
  </head>
<body>
  <h1>behavior:hyperlink</h1>
  <p>Standard hyperlink behavior. It can be applied to any DOM element having <code>href</code> attribute defined.</p>
  <h2>Elements</h2>
  <p>These elements have behavior:button applied by default:</p>
  <ul>
    <li><code>&lt;a href=&quot;url&quot;&gt;...&lt;/a&gt;</code></li></ul>
  <h2>Attributes</h2>
  <p>This behavior knows about:</p>
  <ul>
    <li><code>href=&quot;url&quot;</code> - hyperlink url;</li>
    <li><code>target=&quot;ID&quot;</code> - ID of frame element where to load the URL content.</li></ul>
  <h2>Events</h2>
  <p>Other than standard set of events (mouse, keyboard, focus) behavior:hyperlink generates:</p>
  <ul>
    <li>HYPERLINK_CLICK event, generated on mouse down/up or <code>spacebar</code> key press events when button is in focus. Posted (asynchronous) event.</li></ul>
  <p>If this is event is not consumed by user's code then nearest document will handle URL loading.</p>
  <h2>Methods</h2>
  <p>N/A - behavior:hyperlink does not introduce any specific methods.</p>
  <h2>Value</h2>
  <p>N/A.</p>
  <h2>Hyperlink click handling in script</h2>
  <h3>raw <code>onClick</code> handler</h3>
  <pre>var btn = $(a#some);
btn.onClick = function() { event handling code ...; 
                           return true; /*consume the event*/ }
</pre>
  <h3><code>on()</code> subscription</h3>
  <pre>var btn = $(a#some);
btn.on(&quot;click&quot;, function() { ... event handling code ... });
self.on(&quot;click&quot;, &quot;button#some&quot;, function() { ... event handling code ... });
</pre>
  <h3>decorators.tis handler</h3>
  <pre>include &quot;decorators.tis&quot;;
@click @on &quot;a#some&quot; :: ... event handling code ...;
</pre>
</body>
</html>